package com.uflo.test.handler;

import org.hibernate.Session;
import org.springframework.stereotype.Component;

import com.bstek.uflo.env.Context;
import com.bstek.uflo.model.ProcessInstance;
import com.bstek.uflo.process.handler.ActionHandler;
import com.uflo.test.model.BaoXiao;
import com.uflo.test.model.State;

@Component("demo.demoActionHandler")
public class DemoActionHandler implements ActionHandler {

	public void handle(ProcessInstance instance, Context context) {
		System.out.println("报销结束...");
		Session session = context.getSession();
		BaoXiao baoXiao = (BaoXiao) session.get(BaoXiao.class, instance.getBusinessId());
		baoXiao.setState(State.Completed);
		session.update(baoXiao);

	}

}
